package net;

import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

/**
 * An image captcha has an image and a text response
 * that requires the user to read and retype it.
 */
public class ImageCaptcha {
	/** Key for the unique challenge generated for the ReCaptcha user. */
	public final String challengeKey;
	/** Displayable image of the captcha. */
	public ImageIcon getIcon() {
		return new ImageIcon(image);
	}
	private final BufferedImage image;
	public ImageCaptcha(String challengeKey, URL imageURL) throws IOException {
		this.challengeKey = challengeKey;
		image = ImageIO.read(imageURL);
	}

}
